package Action;
import domain.*;

import java.util.List;
import java.util.Map;

import com.opensymphony.xwork2.ActionContext;

import UserService.*;
public class TestStatus {
	private TUserInfo user;
	private UserService userService;
	private String message;
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public TUserInfo getUser() {
		return user;
	}
	public void setUser(TUserInfo user) {
		this.user = user;
	}
	public UserService getUserService() {
		return userService;
	}
	public void setUserService(UserService userService) {
		this.userService = userService;
	}
	public String TestStatus(){
		List A;
		String userId=(String)user.getUserId();
		String sql="select ustatus from TUserInfo where userId='"+userId+"'";
		userService=new UserServiceImpl();
		A=userService.testStatus(sql);
		ActionContext ac=ActionContext.getContext();
		if(A==null||A.equals("")||A.equals("False")){
			this.setMessage("空闲状态");
			ac.put("message", message);
			return "success";
		}else{
			this.setMessage("正在用车");
			ac.put("message", message);
			return "success";
		}
		
	}
	
}
